package com.zeta.file.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.*;
import org.zetaframework.base.entity.Entity;

import java.io.Serial;

/**
 * 文件
 *
 * @author AutoGenerator
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Schema(description = "文件")
@TableName("fs_file")
public class FsFile extends Entity<Long> {

    @Serial
    private static final long serialVersionUID = 1L;

    /** 业务类型 */
    @Schema(description = "业务类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @TableField(value = "biz_type")
    private String bizType;

    /** 桶 */
    @Schema(description = "桶", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "桶不能为空")
    @Size(max = 255, message = "桶长度不能超过255")
    @TableField(value = "bucket")
    private String bucket;

    /** 存储类型 */
    @Schema(description = "存储类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "存储类型不能为空")
    @Size(max = 255, message = "存储类型长度不能超过255")
    @TableField(value = "storage_type")
    private String storageType;

    /** 文件相对地址 */
    @Schema(description = "文件相对地址", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "文件相对地址不能为空")
    @Size(max = 255, message = "文件相对地址长度不能超过255")
    @TableField(value = "path")
    private String path;

    /** 文件访问地址 */
    @Schema(description = "文件访问地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @TableField(value = "url")
    private String url;

    /** 唯一文件名 */
    @Schema(description = "唯一文件名", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "唯一文件名不能为空")
    @Size(max = 255, message = "唯一文件名长度不能超过255")
    @TableField(value = "unique_file_name")
    private String uniqueFileName;

    /** 原始文件名 */
    @Schema(description = "原始文件名", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @TableField(value = "original_file_name")
    private String originalFileName;

    /** 文件类型 */
    @Schema(description = "文件类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @TableField(value = "file_type")
    private String fileType;

    /** 内容类型 */
    @Schema(description = "内容类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @TableField(value = "content_type")
    private String contentType;

    /** 后缀 */
    @Schema(description = "后缀", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @TableField(value = "suffix")
    private String suffix;

    /** 文件大小 */
    @Schema(description = "文件大小", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @TableField(value = "size")
    private Long size;
}
